package com.zy.explore.module.message.application.event.subscribe;

import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

@Component
public class MqReceiver {

    @StreamListener("input1")
    public void input1Listener(String msg) {
        System.out.println("input1 收到消息:" + msg);
    }

    @StreamListener("input2")
    public void input2Listener(String msg) {
        System.out.println("input2 收到消息:" + msg);

    }

    @StreamListener("input3") // 监听对象
    public void input3Listener(@Payload Object msg) {
        System.out.println("input3 收到消息:" + msg);
    }

    @StreamListener("input4") // 事务消息
    public void input4Listener(Object msg) {
        System.out.println("input4 收到事务消息:" + msg);
    }


}
